const mongoose = require('mongoose')
const schema = new mongoose.Schema({
  val: {
   type: String
  },
  title: {
    type: String
  },
  categories: [{
    type: mongoose.SchemaTypes.ObjectId , ref: "Subject"
  }],
  score: {
    type: String
  },
  totalTitle: {
    type: String
  },
  duration: {
    type: String
  },
  totalScore: {
    type: String
  },
  single: [{
    title: {
      type: String
    },
    score: {
      type: String
    },
    total: {
      type: String
    },
    singleOption:[{
      pick: {
        type: String
      },
      answer: {
        type: String
      },
    }]
  }],
  multiple: [{
    title: {
      type: String
    },
    score: {
      type: String
    },
    total: {
      type: String
    },
    pick: [{
      type: String
    }],
    multipleOption:[{
      pick: {
        type: String
      },
      answer: {
        type: String
      },
    }]
  }],
  fill: [{
    title: {
      type: String
    },
    score: {
      type: String
    },
    total: {
      type: String
    },
      pick: {
        type: String
      },
  }],
  
  discuss: [{
    title: {
      type: String
    },
    total: {
      type: String
    },
    score: {
      type: String
    },
    question: {
      type:String
    },
     answer: {
      type: String
      },
 
  }],
  judge: [{
    title: {
      type: String
    },
    total: {
      type: String
    },
    score: {
      type: String
    },
     answer: {
      type: String
      },
      pick: {
        type: String
      },
      question: {
        type:String
      },
 
  }],
})
module.exports = mongoose.model('Test', schema)